import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/detail',
        component: () => import('../views/detail'),
    },
    {
        path: '/film',
        component: () => import('../views/film'),
        children: [
            {
                path: '/film/nowplaying',
                component: () => import('../views/film/nowplaying'),
            },
            {
                path: '/film/comingsoon',
                component: () => import('../views/film/comingsoon'),
            },
            {
                path: '',
                redirect: '/film/nowplaying',
            },
        ],
    },
    {
        path: '/cinema',
        component: () => import('../views/cinema'),
    },
    {
        path: '/center',
        component: () => import('../views/center'),
    },
    {
        path: '/city',
        component: () => import('../views/city')
    },
    {
        path: '/cinema/search',
        component: () => import('../views/search')
    },
    {
        path: '*',
        redirect: '/film',
    }
]

const router = new VueRouter({
    routes
})

export default router
